echo "For interpret strategy, three options:"
#echo "    1. macro improvement + safer-c2rust"
echo "    1. safer-c2rust"
echo "    2. transformation without makefile + safer-c2rust"
read -p "Your choice with number: " OPTION_A

echo "For whether improve readability or not, two options:"
echo "    1. Yes, further improve readability"
echo "    2. No, without further improve readability"
read -p "Your choice with number: " OPTION_B

echo "For whether improve for cargo test or not, two options:"
    echo "    1. Yes, further improve for cargo test"
    echo "    2. No, without further improve for cargo test"
read -p "Your choice with number: " OPTION_C

#PROJECT_DIR="urlparser/url.h"
read -p "Please input relative project path in Input/: " PROJECT_DIR

########

image_name="c2rust-016:latest"
base_dir="$(readlink -f .)"

if docker ps | grep running_c2rust;then
    docker stop running_c2rust
fi

if docker ps -a | grep running_c2rust;then
    docker rm running_c2rust
fi

#if docker images | grep c2rust-016;then
#    docker rmi c2rust-016
#fi

if [ "$(docker images -q ${image_name} 2> /dev/null)" == "" ]; then
    echo "${image_name}镜像不存在，开始构建..."
    docker build --add-host=github.com:20.205.243.166 -t ${image_name} .
fi

#echo docker run --name running_c2rust -v ${base_dir}/Input/"${PROJECT_DIR}":/Input -v ${base_dir}/Output:/Output \
# -e OPTION_A="${OPTION_A}" -e OPTION_B="${OPTION_B}" -e OPTION_C="${OPTION_C}" \
# -e PROJECT_NAME=$(basename "$PROJECT_DIR") \
#${image_name}

docker run --name running_c2rust -v ${base_dir}/Input/"${PROJECT_DIR}":/Input -v ${base_dir}/Output:/Output \
 -e OPTION_A="${OPTION_A}" -e OPTION_B="${OPTION_B}" -e OPTION_C="${OPTION_C}" \
 -e PROJECT_NAME=$(basename "$PROJECT_DIR") \
${image_name}




